#ifndef IMAGEPROCESS_H
#define IMAGEPROCESS_H

#include <QtCore>
//#include "qimage.h"
#include "qpixmap.h"

#include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>

class ImageProcess : public QObject
{
	Q_OBJECT

public:
	ImageProcess(int height, int width);
	~ImageProcess();
	void setDataSavingSpace(unsigned char *data);
	void setWidth(int width);
	void setHeight(int height);
	void imageToPixmap(QImage &image);
	void saveOriginalData(unsigned short *data);
	void enableSaveData();
	void setImageColorOrBlack(bool isColor);
	void setClose(bool close);



signals:
	void showImage(QPixmap image);
	void showImageData(QImage m_image_data);
public slots:
	void dataToImage(unsigned char *data, bool is8bitsPerPixel);
	
private:
	unsigned char *m_imageData;
	unsigned char *m_dataBuffer;
	int m_imageHeight;
	int m_imageWidth;

	QPixmap m_imageShow;
	QImage m_qimage;

	bool m_saveOriginalDataFlag;
	bool m_isColor;
	
	bool m_isclosed;
};

#endif